const Controller = require('../core/base_controller');

class HomeController extends Controller {
    async login() {
        const { ctx } = this;
        try {
            const res = await ctx.service.user.login()
            this.success(res)
        } catch (err) {
            this.error(err.message)
        }

    }
    async register() {
        const { ctx } = this;
        try {
            const res = await ctx.service.user.register()
            this.success(res)
        } catch (err) {
            this.error(err.message)
        }

    }


}

module.exports = HomeController;
